package VisibleForTesting知识;

import com.google.common.annotations.VisibleForTesting;

public class Calculator {

    private int value;

    public Calculator(int value) {
        this.value = value;
    }

    // 这是一个私有方法，原本不应该公开，但为了测试方便，我们使用 @VisibleForTesting 来暴露它
    @VisibleForTesting
    int calculateSquareRoot(int number) {
        if (number < 0) {
            throw new IllegalArgumentException("Number must be non-negative");
        }
        return (int) Math.sqrt(number);
    }

    public int getValue() {
        return value;
    }
}

